\hypertarget{class_q_c_p_legend}{}\section{Q\+C\+P\+Legend Class Reference}
\label{class_q_c_p_legend}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}


Manages a legend inside a \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}}.  


Inheritance diagram for Q\+C\+P\+Legend\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=6.000000cm]{class_q_c_p_legend}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{Selectable\+Part}} \{ \mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a378201c07d500af7126e3ec91652eed7}{sp\+None}} = 0x000, 
\mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a0fa4758962a46fa1dc9da818abae23c4}{sp\+Legend\+Box}} = 0x001, 
\mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7}{sp\+Items}} = 0x002
 \}
\end{DoxyCompactItemize}
\subsection*{Signals}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a82c88464edac07a9eefaf3906268df3b}{selection\+Changed}} (Q\+C\+P\+Legend\+::\+Selectable\+Parts parts)
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a8a77300fd0976d6bdd8000f4e8d114b8}\label{class_q_c_p_legend_a8a77300fd0976d6bdd8000f4e8d114b8}} 
void {\bfseries selectable\+Changed} (Q\+C\+P\+Legend\+::\+Selectable\+Parts parts)
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_q_c_p_legend_a0001a456989bd07ea378883651fabd72}{Q\+C\+P\+Legend}} ()
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a844b709a5632313416655f931c8e5631}\label{class_q_c_p_legend_a844b709a5632313416655f931c8e5631}} 
Q\+Pen {\bfseries border\+Pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_aaddafd5cbe9175512311350bb3b563e6}\label{class_q_c_p_legend_aaddafd5cbe9175512311350bb3b563e6}} 
Q\+Brush {\bfseries brush} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_ae240104de3c3a4cfc0834dbaffa07ac9}\label{class_q_c_p_legend_ae240104de3c3a4cfc0834dbaffa07ac9}} 
Q\+Font {\bfseries font} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_aa96d8f1a183ec2be8c0461c0abebd6db}\label{class_q_c_p_legend_aa96d8f1a183ec2be8c0461c0abebd6db}} 
Q\+Color {\bfseries text\+Color} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_ae4f17a186558c82d2ba269f6e7164dda}\label{class_q_c_p_legend_ae4f17a186558c82d2ba269f6e7164dda}} 
Q\+Size {\bfseries icon\+Size} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a19668bb7f8fafe20d367cebf96269eaf}\label{class_q_c_p_legend_a19668bb7f8fafe20d367cebf96269eaf}} 
int {\bfseries icon\+Text\+Padding} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a5b91d2ea68a4dd20238f660b80cd9945}\label{class_q_c_p_legend_a5b91d2ea68a4dd20238f660b80cd9945}} 
Q\+Pen {\bfseries icon\+Border\+Pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_ad091ff5e11edbe0adecba81c35522ac7}\label{class_q_c_p_legend_ad091ff5e11edbe0adecba81c35522ac7}} 
Selectable\+Parts {\bfseries selectable\+Parts} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a3efbf879f6936ec337690985e567dc6f}\label{class_q_c_p_legend_a3efbf879f6936ec337690985e567dc6f}} 
Selectable\+Parts {\bfseries selected\+Parts} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_add8204bf083c82cc5def29093501a017}\label{class_q_c_p_legend_add8204bf083c82cc5def29093501a017}} 
Q\+Pen {\bfseries selected\+Border\+Pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_ad8eb320ca3a25928982a65163e8f883b}\label{class_q_c_p_legend_ad8eb320ca3a25928982a65163e8f883b}} 
Q\+Pen {\bfseries selected\+Icon\+Border\+Pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a77dfa9340f68ca195f1817a93db09757}\label{class_q_c_p_legend_a77dfa9340f68ca195f1817a93db09757}} 
Q\+Brush {\bfseries selected\+Brush} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a483ffd35d64710a165da87b9d9f11110}\label{class_q_c_p_legend_a483ffd35d64710a165da87b9d9f11110}} 
Q\+Font {\bfseries selected\+Font} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_ab9b469b27787bfb2ce6c8978a31821af}\label{class_q_c_p_legend_ab9b469b27787bfb2ce6c8978a31821af}} 
Q\+Color {\bfseries selected\+Text\+Color} () const
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a866a9e3f5267de7430a6c7f26a61db9f}{set\+Border\+Pen}} (const Q\+Pen \&pen)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a497bbcd38baa3598c08e2b3f48103f23}{set\+Brush}} (const Q\+Brush \&brush)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_aa4cda8499e3cb0f3be415edc02984c73}{set\+Font}} (const Q\+Font \&font)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_ae1eb239ff4a4632fe1b6c3e668d845c6}{set\+Text\+Color}} (const Q\+Color \&color)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a8b0740cce488bf7010da6beda6898984}{set\+Icon\+Size}} (const Q\+Size \&size)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a96b1a37fd4ee6a9778e6e54fe56ab6c2}{set\+Icon\+Size}} (int width, int height)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a62973bd69d5155e8ea3141366e8968f6}{set\+Icon\+Text\+Padding}} (int padding)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a2f2c93d18a651f4ff294bb3f026f49b8}{set\+Icon\+Border\+Pen}} (const Q\+Pen \&pen)
\item 
Q\+\_\+\+S\+L\+OT void \mbox{\hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}} (const Selectable\+Parts \&selectable\+Parts)
\item 
Q\+\_\+\+S\+L\+OT void \mbox{\hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}} (const Selectable\+Parts \&selected\+Parts)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88}{set\+Selected\+Border\+Pen}} (const Q\+Pen \&pen)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_ade93aabe9bcccaf9cf46cec22c658027}{set\+Selected\+Icon\+Border\+Pen}} (const Q\+Pen \&pen)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd}{set\+Selected\+Brush}} (const Q\+Brush \&brush)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2}{set\+Selected\+Font}} (const Q\+Font \&font)
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a7674dfc7a1f30e1abd1018c0ed45e0bc}{set\+Selected\+Text\+Color}} (const Q\+Color \&color)
\item 
virtual double \mbox{\hyperlink{class_q_c_p_legend_acd7be544c81324e391cfa6be9c413c01}{select\+Test}} (const Q\+PointF \&pos, bool only\+Selectable, Q\+Variant $\ast$details=0) const
\item 
\mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$ \mbox{\hyperlink{class_q_c_p_legend_acfe9694c45104a3359d3806ed366fcf7}{item}} (int index) const
\item 
\mbox{\hyperlink{class_q_c_p_plottable_legend_item}{Q\+C\+P\+Plottable\+Legend\+Item}} $\ast$ \mbox{\hyperlink{class_q_c_p_legend_a91e790002d8bf15a20628a8e8841e397}{item\+With\+Plottable}} (const \mbox{\hyperlink{class_q_c_p_abstract_plottable}{Q\+C\+P\+Abstract\+Plottable}} $\ast$plottable) const
\item 
int \mbox{\hyperlink{class_q_c_p_legend_a57ab86ab8b2a3762d4c1455eb5452c88}{item\+Count}} () const
\item 
bool \mbox{\hyperlink{class_q_c_p_legend_ad0f698e33db454a6c103b5206740e599}{has\+Item}} (\mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$\mbox{\hyperlink{class_q_c_p_legend_acfe9694c45104a3359d3806ed366fcf7}{item}}) const
\item 
bool \mbox{\hyperlink{class_q_c_p_legend_a4b90a442af871582df85c2bc13f91e88}{has\+Item\+With\+Plottable}} (const \mbox{\hyperlink{class_q_c_p_abstract_plottable}{Q\+C\+P\+Abstract\+Plottable}} $\ast$plottable) const
\item 
bool \mbox{\hyperlink{class_q_c_p_legend_a3ab274de52d2951faea45a6d975e6b3f}{add\+Item}} (\mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$\mbox{\hyperlink{class_q_c_p_legend_acfe9694c45104a3359d3806ed366fcf7}{item}})
\item 
bool \mbox{\hyperlink{class_q_c_p_legend_ac91595c3eaa746fe6321d2eb952c63bb}{remove\+Item}} (int index)
\item 
bool \mbox{\hyperlink{class_q_c_p_legend_a2aea4ec6da2d454dd0b241a254d65082}{remove\+Item}} (\mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$\mbox{\hyperlink{class_q_c_p_legend_acfe9694c45104a3359d3806ed366fcf7}{item}})
\item 
void \mbox{\hyperlink{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb}{clear\+Items}} ()
\item 
Q\+List$<$ \mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$ $>$ \mbox{\hyperlink{class_q_c_p_legend_ac7d9e567d5c551e09cd9bcc4306c5532}{selected\+Items}} () const
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a4d552c63d82742d77fb7f177bae7b1ba}\label{class_q_c_p_legend_a4d552c63d82742d77fb7f177bae7b1ba}} 
virtual void {\bfseries parent\+Plot\+Initialized} (\mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} $\ast$parent\+Plot)
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a8e11032dd41db9e53fd3ab0c3c813202}\label{class_q_c_p_legend_a8e11032dd41db9e53fd3ab0c3c813202}} 
virtual \mbox{\hyperlink{namespace_q_c_p_a2ad6bb6281c7c2d593d4277b44c2b037}{Q\+C\+P\+::\+Interaction}} {\bfseries selection\+Category} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a1aea4fc7cdde130a58d0d225440cdbbb}\label{class_q_c_p_legend_a1aea4fc7cdde130a58d0d225440cdbbb}} 
virtual void {\bfseries apply\+Default\+Antialiasing\+Hint} (\mbox{\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter}} $\ast$painter) const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a4462151bf875ca85fa3815457c683fdc}\label{class_q_c_p_legend_a4462151bf875ca85fa3815457c683fdc}} 
virtual void {\bfseries draw} (\mbox{\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter}} $\ast$painter)
\item 
\mbox{\Hypertarget{class_q_c_p_legend_af93bf87dc5c383a9d2ada80b35f3a1a5}\label{class_q_c_p_legend_af93bf87dc5c383a9d2ada80b35f3a1a5}} 
virtual void {\bfseries select\+Event} (Q\+Mouse\+Event $\ast$event, bool additive, const Q\+Variant \&details, bool $\ast$selection\+State\+Changed)
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a5208ead4331c9b0440f768f059777c58}\label{class_q_c_p_legend_a5208ead4331c9b0440f768f059777c58}} 
virtual void {\bfseries deselect\+Event} (bool $\ast$selection\+State\+Changed)
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a1cf9df6f2130c5ad842dc92188ab6bd7}\label{class_q_c_p_legend_a1cf9df6f2130c5ad842dc92188ab6bd7}} 
Q\+Pen {\bfseries get\+Border\+Pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_legend_ab1438d5d67304cdda3b9339da580d6bc}\label{class_q_c_p_legend_ab1438d5d67304cdda3b9339da580d6bc}} 
Q\+Brush {\bfseries get\+Brush} () const
\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a52ab8342a382456131d567f962d7f9d0}\label{class_q_c_p_legend_a52ab8342a382456131d567f962d7f9d0}} 
Q\+Pen {\bfseries m\+Border\+Pen}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a773ae518c3149fcabff4a2906fdacbc4}\label{class_q_c_p_legend_a773ae518c3149fcabff4a2906fdacbc4}} 
Q\+Pen {\bfseries m\+Icon\+Border\+Pen}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a9bd7cd05a9a485e06eda513a348baf80}\label{class_q_c_p_legend_a9bd7cd05a9a485e06eda513a348baf80}} 
Q\+Brush {\bfseries m\+Brush}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a56ffacb184a99eefe09a0c7181d0713d}\label{class_q_c_p_legend_a56ffacb184a99eefe09a0c7181d0713d}} 
Q\+Font {\bfseries m\+Font}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a478b2d809a7390e9ff8f8bb70d6bd9fe}\label{class_q_c_p_legend_a478b2d809a7390e9ff8f8bb70d6bd9fe}} 
Q\+Color {\bfseries m\+Text\+Color}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a39b972aae6c6a3fa5aa73313ab7a5765}\label{class_q_c_p_legend_a39b972aae6c6a3fa5aa73313ab7a5765}} 
Q\+Size {\bfseries m\+Icon\+Size}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a8abf8843864ee9afc3f54f906c062240}\label{class_q_c_p_legend_a8abf8843864ee9afc3f54f906c062240}} 
int {\bfseries m\+Icon\+Text\+Padding}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a917a34dd2856baafd8d56852d94d00e2}\label{class_q_c_p_legend_a917a34dd2856baafd8d56852d94d00e2}} 
Selectable\+Parts {\bfseries m\+Selected\+Parts}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a179b4d5c1bea723b76e402ff48f0d7fb}\label{class_q_c_p_legend_a179b4d5c1bea723b76e402ff48f0d7fb}} 
Selectable\+Parts {\bfseries m\+Selectable\+Parts}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a62906c996906ae23e9f724b6ac1f7334}\label{class_q_c_p_legend_a62906c996906ae23e9f724b6ac1f7334}} 
Q\+Pen {\bfseries m\+Selected\+Border\+Pen}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a7429ac0e64c7b90b649b4d8f4cc5fa55}\label{class_q_c_p_legend_a7429ac0e64c7b90b649b4d8f4cc5fa55}} 
Q\+Pen {\bfseries m\+Selected\+Icon\+Border\+Pen}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_ab3c7567c86d4784b1e48f76a84b3a1e2}\label{class_q_c_p_legend_ab3c7567c86d4784b1e48f76a84b3a1e2}} 
Q\+Brush {\bfseries m\+Selected\+Brush}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a86ce8f6c20a2f51a48eaf3c24ce16805}\label{class_q_c_p_legend_a86ce8f6c20a2f51a48eaf3c24ce16805}} 
Q\+Font {\bfseries m\+Selected\+Font}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a6c25c8796c6e73e983aae6024965f2be}\label{class_q_c_p_legend_a6c25c8796c6e73e983aae6024965f2be}} 
Q\+Color {\bfseries m\+Selected\+Text\+Color}
\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a1cdf9df76adcfae45261690aa0ca2198}\label{class_q_c_p_legend_a1cdf9df76adcfae45261690aa0ca2198}} 
class {\bfseries Q\+Custom\+Plot}
\item 
\mbox{\Hypertarget{class_q_c_p_legend_a8a375e31e42c68de049fcf0fd35db5b0}\label{class_q_c_p_legend_a8a375e31e42c68de049fcf0fd35db5b0}} 
class {\bfseries Q\+C\+P\+Abstract\+Legend\+Item}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Manages a legend inside a \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}}. 

A legend is a small box somewhere in the plot which lists plottables with their name and icon.

Normally, the legend is populated by calling \mbox{\hyperlink{class_q_c_p_abstract_plottable_a70f8cabfd808f7d5204b9f18c45c13f5}{Q\+C\+P\+Abstract\+Plottable\+::add\+To\+Legend}}. The respective legend item can be removed with \mbox{\hyperlink{class_q_c_p_abstract_plottable_ac95fb2604d9106d0852ad9ceb326fe8c}{Q\+C\+P\+Abstract\+Plottable\+::remove\+From\+Legend}}. However, \mbox{\hyperlink{class_q_c_p_legend}{Q\+C\+P\+Legend}} also offers an interface to add and manipulate legend items directly\+: \mbox{\hyperlink{class_q_c_p_legend_acfe9694c45104a3359d3806ed366fcf7}{item}}, \mbox{\hyperlink{class_q_c_p_legend_a91e790002d8bf15a20628a8e8841e397}{item\+With\+Plottable}}, \mbox{\hyperlink{class_q_c_p_legend_a57ab86ab8b2a3762d4c1455eb5452c88}{item\+Count}}, \mbox{\hyperlink{class_q_c_p_legend_a3ab274de52d2951faea45a6d975e6b3f}{add\+Item}}, \mbox{\hyperlink{class_q_c_p_legend_ac91595c3eaa746fe6321d2eb952c63bb}{remove\+Item}}, etc.

The \mbox{\hyperlink{class_q_c_p_legend}{Q\+C\+P\+Legend}} derives from \mbox{\hyperlink{class_q_c_p_layout_grid}{Q\+C\+P\+Layout\+Grid}} and as such can be placed in any position a \mbox{\hyperlink{class_q_c_p_layout_element}{Q\+C\+P\+Layout\+Element}} may be positioned. The legend items are themselves Q\+C\+P\+Layout\+Elements which are placed in the grid layout of the legend. \mbox{\hyperlink{class_q_c_p_legend}{Q\+C\+P\+Legend}} only adds an interface specialized for handling child elements of type \mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}}, as mentioned above. In principle, any other layout elements may also be added to a legend via the normal \mbox{\hyperlink{class_q_c_p_layout_grid}{Q\+C\+P\+Layout\+Grid}} interface. However, the Q\+C\+P\+Abstract\+Legend\+Item-\/\+Interface will ignore those elements (e.\+g. \mbox{\hyperlink{class_q_c_p_legend_a57ab86ab8b2a3762d4c1455eb5452c88}{item\+Count}} will only return the number of items with Q\+C\+P\+Abstract\+Legend\+Items type).

By default, every \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} has one legend (\mbox{\hyperlink{class_q_custom_plot_a4eadcd237dc6a09938b68b16877fa6af}{Q\+Custom\+Plot\+::legend}}) which is placed in the inset layout of the main axis rect (\mbox{\hyperlink{class_q_c_p_axis_rect_a949f803466619924c7018df4b511ae10}{Q\+C\+P\+Axis\+Rect\+::inset\+Layout}}). To move the legend to another position inside the axis rect, use the methods of the \mbox{\hyperlink{class_q_c_p_layout_inset}{Q\+C\+P\+Layout\+Inset}}. To move the legend outside of the axis rect, place it anywhere else with the Q\+C\+P\+Layout/\+Q\+C\+P\+Layout\+Element interface. 

\subsection{Member Enumeration Documentation}
\mbox{\Hypertarget{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}\label{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!Selectable\+Part@{Selectable\+Part}}
\index{Selectable\+Part@{Selectable\+Part}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{Selectable\+Part}{SelectablePart}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{Q\+C\+P\+Legend\+::\+Selectable\+Part}}}

Defines the selectable parts of a legend

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}}, \mbox{\hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}} 
\end{DoxySeeAlso}
\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{sp\+None@{sp\+None}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!sp\+None@{sp\+None}}}\mbox{\Hypertarget{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a378201c07d500af7126e3ec91652eed7}\label{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a378201c07d500af7126e3ec91652eed7}} 
sp\+None&{\ttfamily 0x000} None \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{sp\+Legend\+Box@{sp\+Legend\+Box}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!sp\+Legend\+Box@{sp\+Legend\+Box}}}\mbox{\Hypertarget{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a0fa4758962a46fa1dc9da818abae23c4}\label{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a0fa4758962a46fa1dc9da818abae23c4}} 
sp\+Legend\+Box&{\ttfamily 0x001} The legend box (frame) \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{sp\+Items@{sp\+Items}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!sp\+Items@{sp\+Items}}}\mbox{\Hypertarget{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7}\label{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7}} 
sp\+Items&{\ttfamily 0x002} Legend items individually (see \mbox{\hyperlink{class_q_c_p_legend_ac7d9e567d5c551e09cd9bcc4306c5532}{selected\+Items}}) \\
\hline

\end{DoxyEnumFields}


\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_q_c_p_legend_a0001a456989bd07ea378883651fabd72}\label{class_q_c_p_legend_a0001a456989bd07ea378883651fabd72}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{Q\+C\+P\+Legend()}{QCPLegend()}}
{\footnotesize\ttfamily Q\+C\+P\+Legend\+::\+Q\+C\+P\+Legend (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}

Constructs a new \mbox{\hyperlink{class_q_c_p_legend}{Q\+C\+P\+Legend}} instance with {\itshape parent\+Plot} as the containing plot and default values.

Note that by default, \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} already contains a legend ready to be used as \mbox{\hyperlink{class_q_custom_plot_a4eadcd237dc6a09938b68b16877fa6af}{Q\+Custom\+Plot\+::legend}} 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_q_c_p_legend_a3ab274de52d2951faea45a6d975e6b3f}\label{class_q_c_p_legend_a3ab274de52d2951faea45a6d975e6b3f}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!add\+Item@{add\+Item}}
\index{add\+Item@{add\+Item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{add\+Item()}{addItem()}}
{\footnotesize\ttfamily bool Q\+C\+P\+Legend\+::add\+Item (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$}]{item }\end{DoxyParamCaption})}

Adds {\itshape item} to the legend, if it\textquotesingle{}s not present already.

Returns true on sucess, i.\+e. if the item wasn\textquotesingle{}t in the list already and has been successfuly added.

The legend takes ownership of the item. \mbox{\Hypertarget{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb}\label{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!clear\+Items@{clear\+Items}}
\index{clear\+Items@{clear\+Items}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{clear\+Items()}{clearItems()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::clear\+Items (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Removes all items from the legend. \mbox{\Hypertarget{class_q_c_p_legend_ad0f698e33db454a6c103b5206740e599}\label{class_q_c_p_legend_ad0f698e33db454a6c103b5206740e599}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!has\+Item@{has\+Item}}
\index{has\+Item@{has\+Item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{has\+Item()}{hasItem()}}
{\footnotesize\ttfamily bool Q\+C\+P\+Legend\+::has\+Item (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$}]{item }\end{DoxyParamCaption}) const}

Returns whether the legend contains {\itshape itm}. \mbox{\Hypertarget{class_q_c_p_legend_a4b90a442af871582df85c2bc13f91e88}\label{class_q_c_p_legend_a4b90a442af871582df85c2bc13f91e88}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!has\+Item\+With\+Plottable@{has\+Item\+With\+Plottable}}
\index{has\+Item\+With\+Plottable@{has\+Item\+With\+Plottable}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{has\+Item\+With\+Plottable()}{hasItemWithPlottable()}}
{\footnotesize\ttfamily bool Q\+C\+P\+Legend\+::has\+Item\+With\+Plottable (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{class_q_c_p_abstract_plottable}{Q\+C\+P\+Abstract\+Plottable}} $\ast$}]{plottable }\end{DoxyParamCaption}) const}

Returns whether the legend contains a \mbox{\hyperlink{class_q_c_p_plottable_legend_item}{Q\+C\+P\+Plottable\+Legend\+Item}} which is associated with {\itshape plottable} (e.\+g. a \mbox{\hyperlink{class_q_c_p_graph}{Q\+C\+P\+Graph}}$\ast$). If such an item isn\textquotesingle{}t in the legend, returns false.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a91e790002d8bf15a20628a8e8841e397}{item\+With\+Plottable}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_acfe9694c45104a3359d3806ed366fcf7}\label{class_q_c_p_legend_acfe9694c45104a3359d3806ed366fcf7}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!item@{item}}
\index{item@{item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{item()}{item()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$ Q\+C\+P\+Legend\+::item (\begin{DoxyParamCaption}\item[{int}]{index }\end{DoxyParamCaption}) const}

Returns the item with index {\itshape i}.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a57ab86ab8b2a3762d4c1455eb5452c88}{item\+Count}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_a57ab86ab8b2a3762d4c1455eb5452c88}\label{class_q_c_p_legend_a57ab86ab8b2a3762d4c1455eb5452c88}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!item\+Count@{item\+Count}}
\index{item\+Count@{item\+Count}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{item\+Count()}{itemCount()}}
{\footnotesize\ttfamily int Q\+C\+P\+Legend\+::item\+Count (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

Returns the number of items currently in the legend. \begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_acfe9694c45104a3359d3806ed366fcf7}{item}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_a91e790002d8bf15a20628a8e8841e397}\label{class_q_c_p_legend_a91e790002d8bf15a20628a8e8841e397}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!item\+With\+Plottable@{item\+With\+Plottable}}
\index{item\+With\+Plottable@{item\+With\+Plottable}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{item\+With\+Plottable()}{itemWithPlottable()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_q_c_p_plottable_legend_item}{Q\+C\+P\+Plottable\+Legend\+Item}} $\ast$ Q\+C\+P\+Legend\+::item\+With\+Plottable (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{class_q_c_p_abstract_plottable}{Q\+C\+P\+Abstract\+Plottable}} $\ast$}]{plottable }\end{DoxyParamCaption}) const}

Returns the \mbox{\hyperlink{class_q_c_p_plottable_legend_item}{Q\+C\+P\+Plottable\+Legend\+Item}} which is associated with {\itshape plottable} (e.\+g. a \mbox{\hyperlink{class_q_c_p_graph}{Q\+C\+P\+Graph}}$\ast$). If such an item isn\textquotesingle{}t in the legend, returns 0.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a4b90a442af871582df85c2bc13f91e88}{has\+Item\+With\+Plottable}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_ac91595c3eaa746fe6321d2eb952c63bb}\label{class_q_c_p_legend_ac91595c3eaa746fe6321d2eb952c63bb}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!remove\+Item@{remove\+Item}}
\index{remove\+Item@{remove\+Item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{remove\+Item()}{removeItem()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily bool Q\+C\+P\+Legend\+::remove\+Item (\begin{DoxyParamCaption}\item[{int}]{index }\end{DoxyParamCaption})}

Removes the item with index {\itshape index} from the legend.

Returns true, if successful.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a57ab86ab8b2a3762d4c1455eb5452c88}{item\+Count}}, \mbox{\hyperlink{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb}{clear\+Items}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_a2aea4ec6da2d454dd0b241a254d65082}\label{class_q_c_p_legend_a2aea4ec6da2d454dd0b241a254d65082}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!remove\+Item@{remove\+Item}}
\index{remove\+Item@{remove\+Item}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{remove\+Item()}{removeItem()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily bool Q\+C\+P\+Legend\+::remove\+Item (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$}]{item }\end{DoxyParamCaption})}

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Removes {\itshape item} from the legend.

Returns true, if successful.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a24795c7250eb5214fcea16b7217b4dfb}{clear\+Items}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_ac7d9e567d5c551e09cd9bcc4306c5532}\label{class_q_c_p_legend_ac7d9e567d5c551e09cd9bcc4306c5532}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!selected\+Items@{selected\+Items}}
\index{selected\+Items@{selected\+Items}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{selected\+Items()}{selectedItems()}}
{\footnotesize\ttfamily Q\+List$<$ \mbox{\hyperlink{class_q_c_p_abstract_legend_item}{Q\+C\+P\+Abstract\+Legend\+Item}} $\ast$ $>$ Q\+C\+P\+Legend\+::selected\+Items (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

Returns the legend items that are currently selected. If no items are selected, the list is empty.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_abstract_legend_item_a6eed93b0ab99cb3eabb043fb08179c2b}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Selected}}, set\+Selectable 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_a82c88464edac07a9eefaf3906268df3b}\label{class_q_c_p_legend_a82c88464edac07a9eefaf3906268df3b}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!selection\+Changed@{selection\+Changed}}
\index{selection\+Changed@{selection\+Changed}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{selection\+Changed}{selectionChanged}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::selection\+Changed (\begin{DoxyParamCaption}\item[{Q\+C\+P\+Legend\+::\+Selectable\+Parts}]{selection }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [signal]}}

This signal is emitted when the selection state of this legend has changed.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}}, \mbox{\hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_acd7be544c81324e391cfa6be9c413c01}\label{class_q_c_p_legend_acd7be544c81324e391cfa6be9c413c01}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!select\+Test@{select\+Test}}
\index{select\+Test@{select\+Test}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{select\+Test()}{selectTest()}}
{\footnotesize\ttfamily double Q\+C\+P\+Legend\+::select\+Test (\begin{DoxyParamCaption}\item[{const Q\+PointF \&}]{pos,  }\item[{bool}]{only\+Selectable,  }\item[{Q\+Variant $\ast$}]{details = {\ttfamily 0} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [virtual]}}

Layout elements are sensitive to events inside their outer rect. If {\itshape pos} is within the outer rect, this method returns a value corresponding to 0.\+99 times the parent plot\textquotesingle{}s selection tolerance. However, layout elements are not selectable by default. So if {\itshape only\+Selectable} is true, -\/1.\+0 is returned.

See \mbox{\hyperlink{class_q_c_p_layerable_a04db8351fefd44cfdb77958e75c6288e}{Q\+C\+P\+Layerable\+::select\+Test}} for a general explanation of this virtual method.

\mbox{\hyperlink{class_q_c_p_layout_element}{Q\+C\+P\+Layout\+Element}} subclasses may reimplement this method to provide more specific selection test behaviour. 

Reimplemented from \mbox{\hyperlink{class_q_c_p_layout_element_a0b96ae0d7bcfa6e38188fcb1e73e143f}{Q\+C\+P\+Layout\+Element}}.

\mbox{\Hypertarget{class_q_c_p_legend_a866a9e3f5267de7430a6c7f26a61db9f}\label{class_q_c_p_legend_a866a9e3f5267de7430a6c7f26a61db9f}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Border\+Pen@{set\+Border\+Pen}}
\index{set\+Border\+Pen@{set\+Border\+Pen}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Border\+Pen()}{setBorderPen()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Border\+Pen (\begin{DoxyParamCaption}\item[{const Q\+Pen \&}]{pen }\end{DoxyParamCaption})}

Sets the pen, the border of the entire legend is drawn with. \mbox{\Hypertarget{class_q_c_p_legend_a497bbcd38baa3598c08e2b3f48103f23}\label{class_q_c_p_legend_a497bbcd38baa3598c08e2b3f48103f23}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Brush@{set\+Brush}}
\index{set\+Brush@{set\+Brush}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Brush()}{setBrush()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Brush (\begin{DoxyParamCaption}\item[{const Q\+Brush \&}]{brush }\end{DoxyParamCaption})}

Sets the brush of the legend background. \mbox{\Hypertarget{class_q_c_p_legend_aa4cda8499e3cb0f3be415edc02984c73}\label{class_q_c_p_legend_aa4cda8499e3cb0f3be415edc02984c73}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Font@{set\+Font}}
\index{set\+Font@{set\+Font}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Font()}{setFont()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Font (\begin{DoxyParamCaption}\item[{const Q\+Font \&}]{font }\end{DoxyParamCaption})}

Sets the default font of legend text. Legend items that draw text (e.\+g. the name of a graph) will use this font by default. However, a different font can be specified on a per-\/item-\/basis by accessing the specific legend item.

This function will also set {\itshape font} on all already existing legend items.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_abstract_legend_item_a409c53455d8112f71d70c0c43eb10265}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Font}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_a2f2c93d18a651f4ff294bb3f026f49b8}\label{class_q_c_p_legend_a2f2c93d18a651f4ff294bb3f026f49b8}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Icon\+Border\+Pen@{set\+Icon\+Border\+Pen}}
\index{set\+Icon\+Border\+Pen@{set\+Icon\+Border\+Pen}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Icon\+Border\+Pen()}{setIconBorderPen()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Icon\+Border\+Pen (\begin{DoxyParamCaption}\item[{const Q\+Pen \&}]{pen }\end{DoxyParamCaption})}

Sets the pen used to draw a border around each legend icon. Legend items that draw an icon (e.\+g. a visual representation of the graph) will use this pen by default.

If no border is wanted, set this to {\itshape Qt\+::\+No\+Pen}. \mbox{\Hypertarget{class_q_c_p_legend_a8b0740cce488bf7010da6beda6898984}\label{class_q_c_p_legend_a8b0740cce488bf7010da6beda6898984}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Icon\+Size@{set\+Icon\+Size}}
\index{set\+Icon\+Size@{set\+Icon\+Size}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Icon\+Size()}{setIconSize()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Icon\+Size (\begin{DoxyParamCaption}\item[{const Q\+Size \&}]{size }\end{DoxyParamCaption})}

Sets the size of legend icons. Legend items that draw an icon (e.\+g. a visual representation of the graph) will use this size by default. \mbox{\Hypertarget{class_q_c_p_legend_a96b1a37fd4ee6a9778e6e54fe56ab6c2}\label{class_q_c_p_legend_a96b1a37fd4ee6a9778e6e54fe56ab6c2}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Icon\+Size@{set\+Icon\+Size}}
\index{set\+Icon\+Size@{set\+Icon\+Size}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Icon\+Size()}{setIconSize()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Icon\+Size (\begin{DoxyParamCaption}\item[{int}]{width,  }\item[{int}]{height }\end{DoxyParamCaption})}

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. \mbox{\Hypertarget{class_q_c_p_legend_a62973bd69d5155e8ea3141366e8968f6}\label{class_q_c_p_legend_a62973bd69d5155e8ea3141366e8968f6}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Icon\+Text\+Padding@{set\+Icon\+Text\+Padding}}
\index{set\+Icon\+Text\+Padding@{set\+Icon\+Text\+Padding}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Icon\+Text\+Padding()}{setIconTextPadding()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Icon\+Text\+Padding (\begin{DoxyParamCaption}\item[{int}]{padding }\end{DoxyParamCaption})}

Sets the horizontal space in pixels between the legend icon and the text next to it. Legend items that draw an icon (e.\+g. a visual representation of the graph) and text (e.\+g. the name of the graph) will use this space by default. \mbox{\Hypertarget{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}\label{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selectable\+Parts@{set\+Selectable\+Parts}}
\index{set\+Selectable\+Parts@{set\+Selectable\+Parts}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Selectable\+Parts()}{setSelectableParts()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Selectable\+Parts (\begin{DoxyParamCaption}\item[{const Selectable\+Parts \&}]{selectable }\end{DoxyParamCaption})}

Sets whether the user can (de-\/)select the parts in {\itshape selectable} by clicking on the \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} surface. (When \mbox{\hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions}} contains \mbox{\hyperlink{namespace_q_c_p_a2ad6bb6281c7c2d593d4277b44c2b037a269c9af298e257d1108edec0432b5513}{Q\+C\+P\+::i\+Select\+Legend}}.)

However, even when {\itshape selectable} is set to a value not allowing the selection of a specific part, it is still possible to set the selection of this part manually, by calling \mbox{\hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}} directly.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{Selectable\+Part}}, \mbox{\hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88}\label{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Border\+Pen@{set\+Selected\+Border\+Pen}}
\index{set\+Selected\+Border\+Pen@{set\+Selected\+Border\+Pen}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Selected\+Border\+Pen()}{setSelectedBorderPen()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Selected\+Border\+Pen (\begin{DoxyParamCaption}\item[{const Q\+Pen \&}]{pen }\end{DoxyParamCaption})}

When the legend box is selected, this pen is used to draw the border instead of the normal pen set via \mbox{\hyperlink{class_q_c_p_legend_a866a9e3f5267de7430a6c7f26a61db9f}{set\+Border\+Pen}}.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}}, \mbox{\hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}}, \mbox{\hyperlink{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd}{set\+Selected\+Brush}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd}\label{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Brush@{set\+Selected\+Brush}}
\index{set\+Selected\+Brush@{set\+Selected\+Brush}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Selected\+Brush()}{setSelectedBrush()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Selected\+Brush (\begin{DoxyParamCaption}\item[{const Q\+Brush \&}]{brush }\end{DoxyParamCaption})}

When the legend box is selected, this brush is used to draw the legend background instead of the normal brush set via \mbox{\hyperlink{class_q_c_p_legend_a497bbcd38baa3598c08e2b3f48103f23}{set\+Brush}}.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}}, \mbox{\hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}}, \mbox{\hyperlink{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88}{set\+Selected\+Border\+Pen}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2}\label{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Font@{set\+Selected\+Font}}
\index{set\+Selected\+Font@{set\+Selected\+Font}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Selected\+Font()}{setSelectedFont()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Selected\+Font (\begin{DoxyParamCaption}\item[{const Q\+Font \&}]{font }\end{DoxyParamCaption})}

Sets the default font that is used by legend items when they are selected.

This function will also set {\itshape font} on all already existing legend items.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_aa4cda8499e3cb0f3be415edc02984c73}{set\+Font}}, \mbox{\hyperlink{class_q_c_p_abstract_legend_item_a91db5aee48617a9d3206e61376807365}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Selected\+Font}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_ade93aabe9bcccaf9cf46cec22c658027}\label{class_q_c_p_legend_ade93aabe9bcccaf9cf46cec22c658027}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Icon\+Border\+Pen@{set\+Selected\+Icon\+Border\+Pen}}
\index{set\+Selected\+Icon\+Border\+Pen@{set\+Selected\+Icon\+Border\+Pen}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Selected\+Icon\+Border\+Pen()}{setSelectedIconBorderPen()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Selected\+Icon\+Border\+Pen (\begin{DoxyParamCaption}\item[{const Q\+Pen \&}]{pen }\end{DoxyParamCaption})}

Sets the pen legend items will use to draw their icon borders, when they are selected.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}{set\+Selected\+Parts}}, \mbox{\hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}}, \mbox{\hyperlink{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2}{set\+Selected\+Font}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}\label{class_q_c_p_legend_a2aee309bb5c2a794b1987f3fc97f8ad8}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Parts@{set\+Selected\+Parts}}
\index{set\+Selected\+Parts@{set\+Selected\+Parts}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Selected\+Parts()}{setSelectedParts()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Selected\+Parts (\begin{DoxyParamCaption}\item[{const Selectable\+Parts \&}]{selected }\end{DoxyParamCaption})}

Sets the selected state of the respective legend parts described by \mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{Selectable\+Part}}. When a part is selected, it uses a different pen/font and brush. If some legend items are selected and {\itshape selected} doesn\textquotesingle{}t contain \mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7}{sp\+Items}}, those items become deselected.

The entire selection mechanism is handled automatically when \mbox{\hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions}} contains i\+Select\+Legend. You only need to call this function when you wish to change the selection state manually.

This function can change the selection state of a part even when \mbox{\hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}} was set to a value that actually excludes the part.

emits the \mbox{\hyperlink{class_q_c_p_legend_a82c88464edac07a9eefaf3906268df3b}{selection\+Changed}} signal when {\itshape selected} is different from the previous selection state.

Note that it doesn\textquotesingle{}t make sense to set the selected state \mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1a768bfb95f323db4c66473375032c0af7}{sp\+Items}} here when it wasn\textquotesingle{}t set before, because there\textquotesingle{}s no way to specify which exact items to newly select. Do this by calling \mbox{\hyperlink{class_q_c_p_abstract_legend_item_a6eed93b0ab99cb3eabb043fb08179c2b}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Selected}} directly on the legend item you wish to select.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_a5404de8bc1e4a994ca4ae69e2c7072f1}{Selectable\+Part}}, \mbox{\hyperlink{class_q_c_p_legend_a9ce60aa8bbd89f62ae4fa83ac6c60110}{set\+Selectable\+Parts}}, \mbox{\hyperlink{class_q_c_p_legend_acd7be544c81324e391cfa6be9c413c01}{select\+Test}}, \mbox{\hyperlink{class_q_c_p_legend_a2c35d262953a25d96b6112653fbefc88}{set\+Selected\+Border\+Pen}}, \mbox{\hyperlink{class_q_c_p_legend_ade93aabe9bcccaf9cf46cec22c658027}{set\+Selected\+Icon\+Border\+Pen}}, \mbox{\hyperlink{class_q_c_p_legend_a875227f3219c9799464631dec5e8f1bd}{set\+Selected\+Brush}}, \mbox{\hyperlink{class_q_c_p_legend_ab580a01c3c0a239374ed66c29edf5ad2}{set\+Selected\+Font}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_a7674dfc7a1f30e1abd1018c0ed45e0bc}\label{class_q_c_p_legend_a7674dfc7a1f30e1abd1018c0ed45e0bc}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Selected\+Text\+Color@{set\+Selected\+Text\+Color}}
\index{set\+Selected\+Text\+Color@{set\+Selected\+Text\+Color}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Selected\+Text\+Color()}{setSelectedTextColor()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Selected\+Text\+Color (\begin{DoxyParamCaption}\item[{const Q\+Color \&}]{color }\end{DoxyParamCaption})}

Sets the default text color that is used by legend items when they are selected.

This function will also set {\itshape color} on all already existing legend items.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_legend_ae1eb239ff4a4632fe1b6c3e668d845c6}{set\+Text\+Color}}, \mbox{\hyperlink{class_q_c_p_abstract_legend_item_a4d01d008ee1a5bfe9905b0397a421936}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Selected\+Text\+Color}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_legend_ae1eb239ff4a4632fe1b6c3e668d845c6}\label{class_q_c_p_legend_ae1eb239ff4a4632fe1b6c3e668d845c6}} 
\index{Q\+C\+P\+Legend@{Q\+C\+P\+Legend}!set\+Text\+Color@{set\+Text\+Color}}
\index{set\+Text\+Color@{set\+Text\+Color}!Q\+C\+P\+Legend@{Q\+C\+P\+Legend}}
\subsubsection{\texorpdfstring{set\+Text\+Color()}{setTextColor()}}
{\footnotesize\ttfamily void Q\+C\+P\+Legend\+::set\+Text\+Color (\begin{DoxyParamCaption}\item[{const Q\+Color \&}]{color }\end{DoxyParamCaption})}

Sets the default color of legend text. Legend items that draw text (e.\+g. the name of a graph) will use this color by default. However, a different colors can be specified on a per-\/item-\/basis by accessing the specific legend item.

This function will also set {\itshape color} on all already existing legend items.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_abstract_legend_item_a6ebace6aaffaedcdab2d74e88acc2d1e}{Q\+C\+P\+Abstract\+Legend\+Item\+::set\+Text\+Color}} 
\end{DoxySeeAlso}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
R\+:/\+Develop/a0-\/develop/\+Lib\+Q\+Qt/src/charts/qcustomplot/\mbox{\hyperlink{qcustomplot_8h}{qcustomplot.\+h}}\item 
R\+:/\+Develop/a0-\/develop/\+Lib\+Q\+Qt/src/charts/qcustomplot/\mbox{\hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}}\end{DoxyCompactItemize}
